<?php
/**
 * Description du model d'un item de menu.
 * 
 * @author François Guégnaud
 *
 */
class HackInPain_Navigation_Item_Model extends HackInPain_Model_Abstract {
	
	// Declaration des proprietes
	protected $_id;
	protected $_libelle;
	protected $_controller;
	protected $_action;
	protected $_sous_menu; // doit etre un tableau
	protected $_is_selected = false; // boolean
	protected $_unclickable;
	protected $_allows;
	
	// setters...
	public function setSous_menu(array $sous_menu) {
		$this->_sous_menu = $sous_menu;
	}

	/**
	 * Passe la propriete _is_selected a vrai
	 */
	public function selected() {
		$this->_is_selected = true;
	}
	
	/**
	 * Check la propriete _is_selected
	 * @return $this->_is_selected
	 */
	public function isSelected() {
		return $this->_is_selected;
	}
	
	/**
	 * Check si l'item contient un sous-menu
	 * @return bool
	 */
	public function hasSousMenu() {
		if(isset($this->_sous_menu)) {
			return true;
		} else {
			return false;
		}
	}
	
	/**
	 * Getter de la propriete _sous_menu
	 * @return array $this->_sous_menu
	 */
	public function getSousMenu() {
		return $this->_sous_menu;
	}
}